<script type="text/javascript">
<!--
	function checkForm()
	{ldelim}
		if (jQuery.trim($('#p_name').val()) == '') {ldelim}
			alert('Bạn chưa nhập tên Projects');
			$('#p_name').focus();
			return false;
		{rdelim}

		if ($("input:checked").length == 0) {ldelim}
			alert('Bạn chưa chọn modules cho Projects');
			return false;
		{rdelim}

	    if ($('#proj_lang').val() == '') {ldelim}
            alert('Bạn chưa chọn ngôn ngữ cho Project');
            return false;
	    {rdelim}
		if ( ! $('#templ').attr('checked', 'checked')) {ldelim}
			alert('Bạn chưa chọn template');
			return false;
		{rdelim}
		return true;
	{rdelim}

    function selLanguage(id)
    {ldelim}
      if ($('#' + id).is(':checked')) {ldelim}
        var lang = $('#proj_lang').val();
        lang += $('#' + id).val() + ',';
        $('#proj_lang').val(lang);
      {rdelim} else {ldelim}
        var lang = $('#proj_lang').val();
        lang = lang.replace($('#' + id).val() + ',', '');
        $('#proj_lang').val(lang);
      {rdelim}
    {rdelim}
	/**
	 * @function executeCancel
	 *
	 *
	 */
	function executeCancel()
	{ldelim}
		window.history.back(-1);
	{rdelim}

//-->
</script>
<div id="leftBox">
<div class="{$clsType}Box" style="display:{$msgBoxDisp}">
  <div class="{$clsType}BoxTop" style="display:{$msgBoxDisp}">&nbsp;</div>
  	{foreach from=$messages item=arrMsg}
    	{foreach from=$arrMsg item=msg}
    	<div class="msgBoxContent {$clsIcon}">
      	<p>{$msg}</p>
      	</div>
      {/foreach}
    {/foreach}
</div>
<form id="mainForm" name="mainForm" method="post" action="{$actionForm}">
<div class="contentBox" id="forms">
  <div class="contentBoxTop"><h3>Thêm / Chỉnh sửa Projects</h3><ul class="switcherTabs">
    </ul>
  </div>

      <div class="innerContent" id="box-1"><p><strong>Tên Projects</strong><em> (Chú ý khi tạo tên Projects)</em><br>
          <label class="smallInput">
          	<input name="p_name" id="p_name" value="{$module->m_name|escape}" style="width: 168px;" type="text">
          </label>
          </p><p><strong>Projects Modules</strong><br>
          {foreach from=$arrModule item=row}
          <ul style="display:block;">
          	{foreach from=$row item=module}
          	<li style="width:155px; float:left;">
          	  <label for="m_name{$module->m_id}">
          		<input name="m_name[{$module->m_id}]" id="m_name{$module->m_id}" value="{$module->m_id}" type="checkbox"><a style="text-decoration:none;" title="{$module->m_discr|escape}">{$module->m_name|escape}</a>
          	  </label>
          	</li>
          	{/foreach}
          </ul>
          {/foreach}
          </p>
          <div style="clear:both;"></div>
          <p><strong>Ngôn ngữ Project</strong><br>
          <ul>
            <li style="float:left;width:60px;">
              <label for="lang1"><input type="checkbox" id="lang1" name="lang1" value="vn" onclick="selLanguage('lang1')">&nbsp;<img src="{$base_media}/images/vn.png" title="Tiếng Việt"></label>
            </li>
            <li style="float:left;width:60px;">
              <label for="lang2"><input type="checkbox" id="lang2" name="lang2" value="en" onclick="selLanguage('lang2')">&nbsp;<img src="{$base_media}/images/us.png" title="Tiếng Anh"></label>
            </li>
            <li style="float:left;width:60px;">
              <label for="lang3"><input type="checkbox" id="lang3" name="lang3" value="jp" onclick="selLanguage('lang3')">&nbsp;<img src="{$base_media}/images/japan.png" title="Tiếng Nhật"></label>
            </li>
            <li style="float:left;width:60px;">
              <label for="lang4"><input type="checkbox" id="lang4" name="lang4" value="fr" onclick="selLanguage('lang4')">&nbsp;<img src="{$base_media}/images/france.png" title="Tiếng Pháp"></label>
            </li>
            <li style="float:left;width:60px;">
              <label for="lang5"><input type="checkbox" id="lang5" name="lang5" value="kr" onclick="selLanguage('lang5')">&nbsp;<img src="{$base_media}/images/korea.png" title="Tiếng Hàn"></label>
            </li>
            <li style="float:left;width:60px;">
              <label for="lang6"><input type="checkbox" id="lang6" name="lang6" value="cn" onclick="selLanguage('lang6')">&nbsp;<img src="{$base_media}/images/ch.png" title="Tiếng Hoa"></label>
            </li>
            <li style="float:left;width:60px;">
              <label for="lang7"><input type="checkbox" id="lang7" name="lang7" value="de" onclick="selLanguage('lang7')">&nbsp;<img src="{$base_media}/images/germany.png" title="Tiếng Đức"></label>
            </li>
          </ul>
          </p>
          <div style="clear:both;"></div>
		  <p><strong>Templates</strong>
			<label for="smartadmin"><input type="radio" name="templ" id="smartadmin" value="S"> Smart Admin</label>
			<label for="titanium"><input type="radio" name="templ" id="titanium" value="T"> Titanium</label>
		  </p>
		  <div style="clear:both;"></div>
          <p>
            <input name="" src="{$base_media}/images/bt_submit.gif" onclick="return checkForm();" type="image">
          </p>
      </div>

</div>
<input name="m_id" id="m_id" value="{$modules_id}" type="hidden">
<input name="parent_id" id="parent_id" value="{$parent_id}" type="hidden">
<input name="proj_lang" id="proj_lang" value="" type="hidden">
</form>
</div>

<div id="sidebar" class="rightBoxes">
  <div class="rightBoxesTop">
    <h3>Chức năng<br></h3>
  </div>
  <div class="rightContent">
    <ul id="sidebarLinks">
      <li><a href="javascript:void(0);" onclick="javascript:executeCancel()">##SUBMIT_CANCEL##</a></li>
    </ul>
  </div>
</div>
<!-- end of #sidebar -->
